#include <iostream>
#include <string.h>
using namespace std;
template<class T>
T add(T t1, T t2){
    return t1 +t2;
}
//特化模板
template <>
const char * add<const char *>(const char * p1,const char* p2){
    char * ptemp = new char[strlen(p1) + strlen(p2)+1]();
    strcpy(ptemp,p1);
    strcat(ptemp,p2);
    return ptemp;
}
void test(){
    const char * pstr = "hello";
    const char * pstr2 = "world";
    cout <<add(pstr,pstr2)<<endl;
}
int main()
{
    test();
    return 0;
}

